﻿//regex des dates manquant

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using SchoolProject2012.Langue;

namespace SchoolProject2012.Domain
{
    [MetadataType(typeof(OffreDeStageCV))]
    public class OffreDeStage
    {
        public int id { get; set; }
        public string libelle { get; set; }
        public string contenu { get; set; }
        public DateTime datePublication { get; set; }
        public string dureeStage { get; set; }
        public string remunerationStage { get; set; }
        public string lieuStage { get; set; }
        public string contratPropose { get; set; }
        public int idEntreprise { get; set; }

        #region controle de validite
        public class OffreDeStageCV
        {
            public int id { get; set; }
            [StringLength(50), Required]
            public string libelle { get; set; }
            public string contenu { get; set; }
            public DateTime datePublication { get; set; }
            [StringLength(50), Required]
            public string dureeStage { get; set; }
            [StringLength(50), Required]
            public string remunerationStage { get; set; }
            [StringLength(50), Required]
            public string lieuStage { get; set; }
            [StringLength(50), Required]
            public string contratPropose { get; set; }
            public int idEntreprise { get; set; }

            public OffreDeStageCV() { }

            public OffreDeStageCV(OffreDeStage off)
            {
                id = off.id;
                libelle = off.libelle;
                contenu = off.contenu;
                datePublication = off.datePublication;
                dureeStage = off.dureeStage;
                remunerationStage = off.remunerationStage;
                lieuStage = off.lieuStage;
                contratPropose = off.contratPropose;
                idEntreprise = off.idEntreprise;
            }
        }
        #endregion
    }
}